# -*- coding:UTF-8 -*-
from flask import send_file

from boxtool import get_hot_ip_job


from flask import Flask
from apscheduler.schedulers.background import BackgroundScheduler
from spider_xue.sp import play_for_one, set_account, set_nine_time_stamp
from spider_xue.thread_file import mission_together_one_mintue

app = Flask(__name__)


if __name__ == '__main__':

    scheduler = BackgroundScheduler()
    set_nine_time_stamp()
    set_account()
    # scheduler.add_job(func=pp, trigger='interval', seconds=2 )
    # scheduler.add_job(func=set_nine_time_stamp, trigger='cron', hour=9, minute=14, second=40)
    # scheduler.add_job(func=set_account, trigger='cron', hour=9, minute=3, second=20)

    # scheduler.add_job(func=get_hot_ip_job, trigger='cron', minute='*/40')
    
    scheduler.add_job(func=play_for_one, trigger='cron', day_of_week='mon-fri', hour='9-14', minute='*/2', second=1, args=(mission_together_one_mintue, ))
    scheduler.add_job(func=play_for_one, trigger='cron', day_of_week='mon-fri', hour='15', minute='2', second=1, args=(mission_together_one_mintue, ))
    
    # scheduler.add_job(func=play_for_five_without_flag, trigger='cron', day_of_week ='mon-fri', hour=15, minute=3, second=8, args=(mission_five, ))
   
    # scheduler.add_job(func=play_for_day_without_flag, trigger='cron', day_of_week='mon-fri', hour=15, minute=19, second=58, args=(mission_day_all_stock, ))

    scheduler.start()

    app.debug = False # 设置调试模式，生产模式的时候要关掉debug

    app.run(host="0.0.0.0", port=7893)


    
    
    